Ray tracing systems can be configured to render images from 3-D scene descriptions. The images can be photorealistic, or achieve other objectives. For example, animated movies can be produced using ray tracing systems. Ray tracing techniques mimic the natural interaction of light with objects, and sophisticated rendering features can naturally arise from ray tracing a 3-D scene. Ray tracing can be parallelized relatively easily on the pixel by pixel level also, because pixels generally are processed independently of each other. Ray tracing allows for realistic images to be rendered but often requires high levels of processing power and large working memories, such that ray tracing can be difficult to implement for rendering images in real-time (e.g. for use with gaming applications), particularly on devices which have tight constraints on silicon area, cost and power consumption, such as on mobile devices (e.g. smart phones, tablets, laptops, etc.).
A ray tracing system stores ray data for rays that are to be processed. The rays may be processed by performing intersection testing of the rays with geometry of a 3-D scene to be rendered. The geometry typically comprises primitives representing surfaces of objects in the scene. Primitives are often triangles defined by data at three vertices, but primitives may be other shapes such as other two dimensional polygons, nurbs, quadrilateral patches, or procedurally defined surfaces. A shader program may be executed in response to an intersection between a ray and a primitive. A shader program typically includes one or more shader instructions to be executed. Ray tracing systems can store ray data describing the rays to be processed in the scene. The ray data for a ray may include many different components describing different characteristics of the ray.
A ray may be represented as a vector. Typically, the ray data for a ray includes a ray origin which defines an origin of the ray in the 3D scene to be rendered, and a ray direction which defines the direction of the ray through the 3D scene. The ray origin and ray direction in the 3D scene may each be described with three components, such as x, y and z components. For example, each of these six components (i.e. x, y and z components for the ray origin and ray direction) may be represented with a 32-bit floating point number, but in other examples different formats and numbers of bits may be used for these components. Direction vectors are normalised (i.e. scaled such that the sum of the square of the components equals one, i.e. x2+y2+z2=1) so that they purely represent direction with the magnitude of the normalised direction vectors equaling one.
Ray tracing systems may benefit from parallel processing of a large number of rays. Therefore, a large memory may be needed to store the ray data, which can be detrimental in terms of silicon area usage and cost of the ray tracing system.
Furthermore writing ray data into, and reading ray data from, a memory consumes power and time, so a large amount of ray data may result in increased power consumption and latency of the ray tracing system.